
export const productColumns = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' },
    fixed: 'left'
  },
  {
    title: '名称',
    dataIndex: 'goodsName',
    fixed: 'left'
  },
  {
    title: '品牌',
    dataIndex: 'brand'
  },
  {
    title: '参数',
    dataIndex: 'options'
  },
  {
    title: '单位',
    dataIndex: 'unit'
  },
  {
    title: '数量',
    dataIndex: 'count'
  },
  {
    title: '单价',
    dataIndex: 'price'
  },
  {
    title: '供应商',
    dataIndex: 'supplierName'
  },
  {
    title: '备注',
    dataIndex: 'note'
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '150px',
    scopedSlots: { customRender: 'action' },
    fixed: 'right'
  }
]

export const productColumns2 = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '名称',
    dataIndex: 'productName'
  },
  {
    title: '品牌',
    dataIndex: 'brand'
  },
  {
    title: '参数',
    dataIndex: 'options'
  },
  {
    title: '单位',
    dataIndex: 'unit'
  },
  {
    title: '数量',
    dataIndex: 'count'
  },
  {
    title: '单价',
    dataIndex: 'price'
  },
  {
    title: '备注',
    dataIndex: 'note'
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '150px',
    scopedSlots: { customRender: 'action' }
  }
]

export const teamColumns = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '姓名',
    dataIndex: 'name'
  },
  {
    title: '性别',
    dataIndex: 'sex',
    scopedSlots: { customRender: 'sex' }
  },
  {
    title: '岗位',
    dataIndex: 'jobs'
  },
  {
    title: '项目职责',
    dataIndex: 'projectDuty'
  },
  {
    title: '备注',
    dataIndex: 'note'
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '150px',
    scopedSlots: { customRender: 'action' }
  }
]

export const taskColumns = [
  {
    title: '#'
  },
  {
    title: '任务名称',
    dataIndex: 'taskName'
  },
  {
    title: '状态',
    scopedSlots: { customRender: 'status' }
  },
  {
    title: '完成质量',
    dataIndex: 'completeQualityName'
  },
  {
    title: '负责人',
    dataIndex: 'userNames'
  },
  {
    title: '操作',
    dataIndex: 'action',
    scopedSlots: { customRender: 'action' }
  }
]

export const fileColumns = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '任务名称',
    dataIndex: 'fileName',
    scopedSlots: { customRender: 'fileName' }
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '150px',
    scopedSlots: { customRender: 'action' }
  }
]

export const contractColumns = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '签订日期',
    dataIndex: 'signDate'
  },
  {
    title: '合同名称',
    dataIndex: 'contractName'
  },
  {
    title: '总金额',
    dataIndex: 'money'
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '150px',
    scopedSlots: { customRender: 'action' }
  }
]

export const supplierContractColumns = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '签订日期',
    dataIndex: 'signDate'
  },
  {
    title: '合同名称',
    dataIndex: 'contractName'
  },
  {
    title: '总金额',
    dataIndex: 'money'
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '150px',
    scopedSlots: { customRender: 'action' }
  }
]

export const filterEmptyPro = (obj) => {
  const pam = {}
  for (const i in obj) {
    if (obj[i]) {
      pam[i] = obj[i]
    }
  }
  return pam
}

export const showFinish = (task) => {
  if (task.taskLevel === 1) {
    return false
  } else if (task.taskLevel === 2) {
   return task.progress !== 1
  } else if (task.taskLevel === 3) {
    return task.status !== 3
   }
   return false
}
